package co.th.bjc.md.helper.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

	protected static String ddMMyyyy = "dd/MM/yyyy";
	
	protected static SimpleDateFormat sdf = new SimpleDateFormat();
	
	public static Date stringToDate(String dateStr) throws Exception{
		return stringToDate(dateStr, ddMMyyyy);
	}
	
	public static Date stringToDate(String dateStr, String pattern) throws Exception{
		sdf.applyPattern(pattern);
		return sdf.parse(dateStr);
	}
}
